<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/* JoomLeague League Management and Prediction Game for Joomla!
 * @version $Id: edit_squad.tpl.php 1227 2008-07-14 11:24:14Z julienv $
 * @package Joomleague
 * @copyright Copyright (C) 2007  JoomLeague
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see _joomleague_license.txt
 *  
 * Homepage: http://www.joomleague.de
 * Support: htt://www.joomleague.de/forum/
 * 
 * This file is part of JoomLeague.
 *  
 * JoomLeague is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Please note that the GPL states that any headers in files and
 * Copyright notices as well as credits in headers, source files
 * and output (screens, prints, etc.) can not be removed.
 * You can extend them with your own credits, though...
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/copyleft/gpl.html.
*/ 
?>


<div class="slider" id="slide_startingSquads" style="display:<?php echo $display;?>">

  <div><a href="javascript:void(0);" onclick="if (checkforchanges()) {document.getElementById('slide_startingSquads').style.display='none';}">close</a> 
    <b><?php echo jl_utf8_convert($teamname);?></b>
  </div>
  
  <div id="lineup">
    <h2><?php echo _JL_LINEUP_SET_STARTERS; ?></h2>
    <form id="startingSquadsForm" name="startingSquadsForm" 
          action="javascript:jl_PostForm( serializeLineupForm( document.getElementById('startingSquadsForm') ), 'editarea' );" 
          enctype="application/x-www-form-urlencoded">
          
        <input type="hidden" name="mid" value="<?php echo $this->match->match_id;?>" />
        <input type="hidden" name="mytask" value="savesquads" />
        <input type="hidden" name="team" id="team" value="<?php echo $team;?>" />
        <input type="hidden" name="func" id="func" value="editEvents" />
        <input type="hidden" name="act" id="act" value="editEvents" />
        <input type="hidden" name="p" id="p" value="<?php echo $this->project->id;?>" />
        <input type="hidden" name="changes_check" id="changes_check" value="0" />
        <input type="hidden" name="option" id="option" value="com_joomleague" />
        <input type="hidden" name="no_html" id="no_html" value="1" />
			  
	    <table>
	      <tr>
	        <td>
		        <h3><?php echo _JL_LINEUP_NOT_STARTING; ?></h3>
		             <?php
		             // echo select list of non assigned players from team roster
                 echo mosHTML::selectList( $squadoptions, 'sqad[]', 'id="sqad" size="'.max(10, count($squadoptions))
                          .'" style="font-size:9px;height:auto;min-width:15em;" class="inputbox" multiple="true"','value', 'text', '' );?>
		      </td>
          <td>
	          <h3><?php echo _JL_STARTING_ROSTERS; ?></h3>
	          <table>
						<?php
						foreach ($positions AS $key=>$pos) 
						{
						  ?>
							<tr>
							  <td>
								 <input type="button" class="inputbox" 
										         onclick="document.getElementById('changes_check').value=1;move(document.getElementById('sqad'), document.getElementById('sqad<?php echo $key;?>'));selectAll(document.getElementById('sqad<?php echo $key;?>'));" 
										         value="&gt;&gt;" /><br />
								 <input type="button" class="inputbox" 
										         onclick="document.getElementById('changes_check').value=1;document.getElementById('sqad<?php echo $key;?>').focus();move(document.getElementById('sqad<?php echo $key;?>'),document.getElementById('sqad'));selectAll(document.getElementById('sqad<?php echo $key;?>'));" 
										         value="&lt;&lt;" />
							  </td>
			          <td>
			                <b><?php echo $pos->name;?></b><br />
										  <?php
									    echo mosHTML::selectList( $options[$key], 'sqad'.$key.'[]', 'id="sqad'.$key
									      .'" style="font-size:9px;height:auto; min-width:15em;" class="inputbox" multiple="true" onDblClick="document.getElementById(\'changes_check\').value=1;move(this,document.getElementById(\'sqad\'))"','value', 'text', $temp[$key]);
									    ?>	  
							  </td>
							  <td>
		              <input type="button" class="inputbox" 
		                     onclick="moveOptionUp( 'sqad<?php echo $key;?>' );" 
		                     value="UP" /><br />
		              <input type="button" class="inputbox" 
		                     onclick="moveOptionDown( 'sqad<?php echo $key;?>' );" 
		                     value="DOWN" />
		            </td>
		          </tr>
						  <?php
					  }
				    ?>
	          </table>
          </td>
        </tr>
        <tr>
	        <td colspan="2">
			     <input type="submit" class="inputbox" value="<?php echo _JL_SAVE;?>" />
			    </td>
		    </tr>
		  </table>
      </form>
    </div>
    
				<div id="io">
        <h2><?php echo _JL_IN_OUT; ?></h2>
				<form id="Subst" name="homeSubst"
				  action="javascript: jl_PostForm( serializeLineupForm(document.getElementById('Subst')), 'editarea');"
					enctype="application/x-www-form-urlencoded">
				  <input type="hidden" name="mid" value="<?php echo $this->match->match_id;?>" /> 
				  <input type="hidden" name="mytask" value="updatesubst" /> 
				  <input type="hidden" name="team" id="team" value="<?php echo $team;?>" /> 
				  <input type="hidden" name="func" id="func" value="editEvents" /> 
				  <input type="hidden" name="act" id="act" value="editEvents" /> 
				  <input type="hidden" name="p" id="p" value="<?php echo $this->project->id;?>" />
		      <input type="hidden" name="option" id="option" value="com_joomleague" />
		      <input type="hidden" name="no_html" id="no_html" value="1" />
					<table>
						<tr>
							<td>
							 <img	src="<?php echo JL_TEMPLATE_FOLDERS_URL;?>/images/in.png" alt="in" />
								<?php
								echo '<select name="player_in" class="inputbox">';
								foreach ( $in_out_options AS $player_id => $player )
								{
									echo '<option value="'.$player_id.'">'.$player.'</option>';
								}
								echo '</select>';
								?>
							</td>
						</tr>
						<tr>
							<td><img src="<?php echo JL_TEMPLATE_FOLDERS_URL;?>/images/out.png"
								alt="out" /> <?php
								echo '<select name="player_out" class="inputbox">';
								foreach ( $in_out_options AS $player_id => $player )
								{
									echo '<option value="'.$player_id.'">'.$player.'</option>';
								}
								echo '</select>';
								?>
							</td>
						</tr>
						<tr>
							<td><?php
								echo mosHTML::selectList( $poslist, 'position_id',
				                          'id="position" style="font-size:9px;" class="inputbox"','value', 'text', 0 );
								?> <input type="text" size="3" name="in_out_time"
									style="font-size: 9px;" class="inputbox" /> Min.<br />
								<input type="submit" style="font-size: 9px; height: auto;"
									class="inputbox" value="<?php echo _JL_SAVE_SUBSTITUTION;?>" />
							</td>
						</tr>
					</table>
				</form>
				<?php echo $this->substitutionForm($came_in[$team]);?>
				</div>
				
<div class="clear"></div>
</div>
